<?php
/*--------------------------
	file:	cookie.lib
	intro:	cookie底层库函数
--------------------------*/

/*
	function:			写入COOKIE
	@param: $var		COOKIE名
	@param: $value		COOKIE内容
	@param: $life		存活时间
	@param: $prefix		是否需要前缀
	return: string
*/
function dsetcookie($var, $value, $life = 0, $prefix = 1) {
	global $cookiepre, $cookiedomain, $cookiepath, $timestamp, $_SERVER;
	setcookie(($prefix ? $cookiepre : '').$var, $value,
		$life ? $timestamp + $life : 0, $cookiepath,
		$cookiedomain, $_SERVER['SERVER_PORT'] == 443 ? 1 : 0);
}
?>